Bidirectional forwarding detection (Bidirectional Forwarding Detection, BFD) operates under unicast and P2P modes and is used to perform rapid fault detection on any type of channel between network devices.
If multiple channels exist between a pair of network devices, that is, multiple channels exist in at least one direction, multiple BFD sessions need to be correspondingly established between the pair of network devices.
In order to make a received BFD control packet correspond to a corresponding BFD session, each network device needs to select an opaque discriminator value for each BFD session, and discriminator values of all BFD sessions in each network device are unique.
A local discriminator value of each network device is sent through a “My Discriminator (MD for short below)” field of a BFD control packet, and is returned through a “Your Discriminator (YD for short below)” field of a response packet of a remote network device. Once the remote network device returns the local discriminator value, subsequently received BFD control packets are all separated only according to the local discriminator value, that is, different BFD sessions are distinguished by using the discriminator value. Therefore, it can be said that an MD and a YD are the only basis for identifying a pair of BFD sessions. When a session negotiation is UP, receiving and sending of a packet and modification to a session parameter perform matching only according to the MD and the YD.
However, in a same local area network, the probability of same MDs occurring in BFD sessions is extremely large, and MDs generated by BFD sessions may conflict, which results in that the BFD sessions are unable to be negotiated normally.
In the prior art, an authentication option in a BFD control packet is set to ensure correct negotiation between BFD sessions. This, however, requires all network devices to support an authentication function of BFD, implementation is complex, and a user needs to further configure authentication in addition to basic configuration of BFD.